cmake_minimum_required(VERSION 3.12.0)

if(COMMAND cmake_policy)
	cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

project(test)
MESSAGE(STATUS "operation system is ${CMAKE_SYSTEM}")

IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
	set (CMAKE_C_COMPILE "/usr/bin/gcc")
	set (CMAKE_CXX_COMPILE "/usr/bin/g++")
ENDIF()

#add_definitions("-Wall -g")

#文件编译依赖顺序测试
FILE (GLOB LIB_SRC_LIST "./thread_try/*.c")

add_library(libthread SHARED ${LIB_SRC_LIST})
target_link_libraries(libthread PUBLIC pthread)


add_executable(test test.c)

target_link_libraries(test PUBLIC libthread)
target_include_directories(${PROJECT_NAME} PUBLIC 
							${PROJECT_BINARY_DIR} 
							${PROJECT_SOURCE_DIR}/thread_try
							)

#include_directories()

